<template>
  <div>
    <NavBar title="用户中心"/>
    <div class="userCenter" @click="exit">
      <van-nav-bar title="退出登录" />
    </div>

  </div>
</template>

<script>
  import NavBar from '@/components/navBar'
  import {Toast} from 'vant'
  export default{
    data() {
      return {
        show:true
      }
    },
    components:{
      NavBar
    },
    methods:{
      exit (){
        this.$dialog.confirm({
           title: "确定退出",
           confirmButtonText: "确认",
           cancelButtonText: "取消"
        }).then(()=> {
            window.localStorage.clear()
            this.show = false
            this.$router.push('/selectlogin')
            Toast('您已退出登录')
        }).catch(() => {

        })
      }
    }
  }
</script>

<style>
  .userCenter{
    margin-top: 20px;
  }
</style>
